package com.shen.pojo;

import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;

// 不需要set方法也可以注入，因为使用了Autowired注解，其原理为反射
public class People {
    @Autowired
    @Qualifier(value = "dog111")
    private Dog dog;
    @Autowired
    private Cat cat;
    private String name;

    @Override
    public String toString() {
        return "People{" +
                "dog=" + dog +
                ", cat=" + cat +
                ", name='" + name + '\'' +
                '}';
    }
}
